﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Aoxuelf.MDSTool.ViewModel
{
    public class InsertDALSQLViewModel : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        private string mMethodName = string.Empty;
        private bool mIsPage = false;
        private bool mIsTransaction = false;
        private string mSummary = string.Empty;
        private string mSQL = string.Empty;

        public string MethodName
        {
            get { return mMethodName; }
            set 
            { 
                mMethodName = value;
                RaisePropertyChanged("MethodName");
            }
        }

        public string Summary
        {
            get { return mSummary; }
            set
            {
                mSummary = value;
                RaisePropertyChanged("Summary");
            }
        }

        public string SQL
        {
            get { return mSQL; }
            set
            {
                mSQL = value;
                RaisePropertyChanged("SQL");
            }
        }

        public bool IsPage
        {
            get { return mIsPage; }
            set
            {
                mIsPage = value;
                RaisePropertyChanged("IsPage");
            }
        }

        public bool IsTransaction
        {
            get { return mIsTransaction; }
            set
            {
                mIsTransaction = value;
                RaisePropertyChanged("IsTransaction");
            }
        }

        protected void RaisePropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
